<%@ page language="java" import="java.util.*,java.text.*"
	pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<title>高级查询</title>
		<script defer="defer" language="JavaScript" type="text/javascript"
			src="worklog/My97DatePicker/WdatePicker.js"></script>
		<link rel="stylesheet"
			href="worklog/My97DatePicker/skin/WdatePicker.css" type="text/css"></link>
	</head>

	<body>
		<s:form action="list_worklog" method="post" namespace="/worklog">
			<table>
				<tr>
				<s:if test="#session.personInfo.group=='user'">
				</s:if>
					<s:else>
					<td>
							部门：
						</td>
							<td>
							<s:select  name="dept.id" list="deptList" listKey="id" listValue="deptName" headerKey="0" headerValue=" "
								theme="simple">
							</s:select>
						</td>
					<td>
							用户：
						</td>
						
					<td>
					<s:select  name="person.id" list="personList" listKey="id" listValue="name" headerKey="0" headerValue=" " 
								theme="simple">
							</s:select>
						</td>
						</s:else>
						<td colspan="4">
						日期：
						<input id="start" class="Wdate" name="worklog.date" type="text"
							onFocus="WdatePicker({isShowWeek:true,maxDate:'#F{$dp.$D(\'end\')||\'2120-10-01\'}'})" />
						至
						<input id="end" class="Wdate" name="date" type="text"
							onFocus="WdatePicker({isShowWeek:true,minDate:'#F{$dp.$D(\'start\')}',maxDate:'2120-10-01'})" />
						
					</td>
					<td>
						<s:submit type="image" src="worklog/images/query.gif" theme="simple"></s:submit>
					</td>
				</tr>
			</table>
		</s:form>
      <s:if test="#session.personInfo.group=='manager'||#session.personInfo.group=='admin'">
      	<table width="80%" border="1" 
			style="border-collapse: collapse" align="left">
			<tr>
				<td width="10%" align="center">
					日期
				</td>
				<td width="10%" align="center">姓名</td>
				<td>
					日程内容
				</td>
			</tr>
			<s:iterator value="worklogList">
				<tr>
					<td align="center">
						${date}
					</td >
					<td align="center">
						${person.name}
					</td>
					<td>
						${content}
					</td>
				</tr>
			</s:iterator>
			<tr>
				<td align="left" valign="middle" colspan="3">
					<div class="fl">
						<div class="pages">
							${ pagination }
						</div>
					</div>
				</td>
			</tr>
		</table>
      </s:if>
      <s:else>
		<table width="80%" border="1" 
			style="border-collapse: collapse" align="left">
			<tr>
				<td width="10%">
					日期
				</td>
				<td>
					日程内容
				</td>
			</tr>
			<s:iterator value="worklogList">
				<tr>
					<td>
						${date}
					</td>
					<td>
						${content}
					</td>
				</tr>
			</s:iterator>
			<tr>
				<td align="left" valign="middle" colspan="2">
					<div class="fl">
						<div class="pages">
							${ pagination }
						</div>
					</div>
				</td>
			</tr>
		</table>
		</s:else>
	</body>
</html>
